﻿''' <summary>
''' 日志类
''' </summary>
''' <remarks></remarks>
Public Class Logger

    ''应用程序日志
    'Public Shared Sub Write(ByVal msg As String, ByVal category As String)
    '    Write(msg, category, tbccLogApplicationType.Information)
    'End Sub

    'Public Shared Sub Write(ByVal msg As String, ByVal category As String, ByVal appType As tbccLogApplicationType)
    '    Dim categories As ICollection(Of String)
    '    categories = New List(Of String)

    '    categories.Add(category)

    '    Write(msg, categories, appType)
    'End Sub

    'Public Shared Sub Write(ByVal msg As String, ByVal categories As ICollection(Of String), ByVal appType As tbccLogApplicationType)
    '    Write(msg, categories, 0, appType)
    'End Sub

    'Public Shared Sub Write(ByVal msg As String, ByVal categories As ICollection(Of String), ByVal priority As Integer, ByVal appType As tbccLogApplicationType)
    '    Write(msg, categories, priority, appType, Nothing)
    'End Sub

    'Public Shared Sub Write(ByVal msg As String, ByVal categories As ICollection(Of String), ByVal priority As Integer, ByVal appType As tbccLogApplicationType, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    Dim log As New Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry()
    '    log.Message = msg
    '    log.Categories = categories
    '    log.Priority = priority

    '    If ExtendedProperties IsNot Nothing Then
    '        log.ExtendedProperties = ExtendedProperties
    '    End If

    '    Select Case appType
    '        Case tbccLogApplicationType.Information
    '            log.Severity = TraceEventType.Information

    '        Case tbccLogApplicationType.Warning
    '            log.Severity = TraceEventType.Warning

    '        Case tbccLogApplicationType.Error
    '            log.Severity = TraceEventType.Error

    '        Case tbccLogApplicationType.Critical
    '            log.Severity = TraceEventType.Critical

    '        Case Else
    '            log.Severity = TraceEventType.Information

    '    End Select

    '    'Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(log)

    'End Sub

    '''' <summary>
    '''' 一般信息日志
    '''' </summary>
    '''' <param name="msg"></param>
    '''' <remarks></remarks>
    'Public Shared Sub Write(ByVal msg As String)
    '    Write(msg, "Generic")
    'End Sub

    '''' <summary>
    '''' 一般警告日志
    '''' </summary>
    '''' <param name="msg"></param>
    '''' <param name="ExtendedProperties"></param>
    '''' <remarks></remarks>
    'Public Shared Sub WriteWarning(ByVal msg As String, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    Dim categories As New List(Of String)
    '    categories.Add("Warning")
    '    Write(msg, categories, 0, tbccLogApplicationType.Warning, ExtendedProperties)
    'End Sub

    '''' <summary>
    '''' 一般警告日志
    '''' </summary>
    '''' <param name="ex"></param>
    '''' <param name="msg"></param>
    '''' <param name="ExtendedProperties"></param>
    '''' <remarks></remarks>
    'Public Shared Sub WriteWarning(ByVal ex As Exception, ByVal msg As String, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    WriteWarning(msg & " " & ex.Message, ExtendedProperties)
    'End Sub

    '''' <summary>
    '''' 一般错误日志
    '''' </summary>
    '''' <param name="msg"></param>
    '''' <param name="ExtendedProperties"></param>
    '''' <remarks></remarks>
    'Public Shared Sub WriteError(ByVal msg As String, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    Dim categories As New List(Of String)
    '    categories.Add("Error")
    '    Write(msg, categories, 0, tbccLogApplicationType.Error, ExtendedProperties)
    'End Sub

    '''' <summary>
    '''' 一般错误日志
    '''' </summary>
    '''' <param name="ex"></param>
    '''' <param name="msg"></param>
    '''' <param name="ExtendedProperties"></param>
    '''' <remarks></remarks>
    'Public Shared Sub WriteError(ByVal ex As Exception, ByVal msg As String, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    WriteError(msg & " " & ex.Message, ExtendedProperties)
    'End Sub

    '''' <summary>
    '''' 一般致命错误日志
    '''' </summary>
    '''' <param name="msg"></param>
    '''' <param name="ExtendedProperties"></param>
    '''' <remarks></remarks>
    'Public Shared Sub WriteCritical(ByVal msg As String, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    Dim categories As New List(Of String)
    '    categories.Add("Critical")
    '    Write(msg, categories, 0, tbccLogApplicationType.Critical, ExtendedProperties)
    'End Sub

    '''' <summary>
    '''' 一般致命错误日志
    '''' </summary>
    '''' <param name="ex"></param>
    '''' <param name="msg"></param>
    '''' <param name="ExtendedProperties"></param>
    '''' <remarks></remarks>
    'Public Shared Sub WriteCritical(ByVal ex As Exception, ByVal msg As String, ByVal ExtendedProperties As IDictionary(Of String, Object))
    '    WriteCritical(msg & ex.Message, ExtendedProperties)
    'End Sub



#Region "用户日志"

    ''' <summary>
    ''' 用户日志
    ''' </summary>
    ''' <param name="uName"></param>
    ''' <param name="msg"></param>
    ''' <param name="OpType"></param>
    ''' <remarks></remarks>
    Public Shared Sub Write(ByVal uID As String, ByVal uName As String, ByVal msg As String, ByVal OpType As tbccLogOperateType)
        OperateLogClass.Write(uid, uName, msg, OpType)
    End Sub

#End Region


End Class



